import request from './request.js'

// 获取当前ip
export function getIp() {
    return request({
        method: 'get',
        url: 'ip?&key=406c1e5c7999a621162d8bfe17674007'
    })
}


// 返回adcode实况天气
export function getIpWeather(adcode) {
    return request({
        method: 'get',
        url: `weather/weatherInfo?city=${adcode}&key=406c1e5c7999a621162d8bfe17674007&extensions=base`
    })
}

// 返回预测天气
export function getForecastWeather(adcode) {
    return request({
        method: 'get',
        url: `weather/weatherInfo?city=${adcode}&key=406c1e5c7999a621162d8bfe17674007&extensions=all`
    })
}

// 通过城市名字查询 adcode
export function getAdcode(keyword) {
    return request({
        method: 'get',
        url: `geocode/geo?address=${keyword}&key=406c1e5c7999a621162d8bfe17674007&level=市`
    })
}

